#ifndef JSCONTEXT_H
#define JSCONTEXT_H

#include <QObject>
#include <QWebEngineView>

class JsContext : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString text MEMBER m_text NOTIFY textChanged FINAL) //注意这里很重要,会在初始化时候绑定，否则会导致传输延迟
public:
    explicit JsContext(QObject *parent = nullptr): QObject(parent) {};
    void setText(const QString &text);

signals:
    void textChanged(const QString &text);

private:
    QString m_text;
};

#endif // JSCONTEXT_H
